(function ($)
{//全局系统对象
window['XHZ'] = {};

//带文件的ajax提交 处理
XHZ.formPost = function(form, btn , valid, success){
	$submit.addClass('disabled') ;
	if(valid){
		if(!$(form).validate().form()){
			$submit.removeClass('disabled') ;
			return false ;
		}
	}
	
	$.post($(form).attr('action') ,$(form).serialize() ,success) ;
    
};

XHZ.post = function(url ,data, success){
	$.post(url ,data ,success) ;
};

XHZ.alert = function(content){
	var msg = "<h4><span class='danger'>"+content+"</span></h4>" ;
	$('#alertModal .modal-body').html(msg) ;
	$('#alertModal').modal({
		backdrop: 'static' ,
		show: true
	}) ;
} ;

XHZ.confirm = function(content , callback){
	var msg = "<h4><span class='danger'>"+content+"</span></h4>" ;
	$('#dialogModal .modal-body').html(msg) ;
	$('#dialogModal').modal({
		backdrop: 'static' ,
		show: true
	}) ;
	$('#dialogBtn').click(
		callback 
	) ;
} ;
XHZ.confirmClose = function(){
	$('#dialogBtn').unbind() ;
	$('#dialogModal').modal('hide') ;
} ;

XHZ.open = function(url){
	$('#layoutModal').modal({
		backdrop: 'static' ,
		remote: url,
		show: true
	}) ;
} ;

XHZ.close = function(){
	$('#layoutModal').modal('hide') ;
} ;
})(jQuery);
